dojo.provide('snareworks.ImageUtils');

dojo.require('snareworks.ImageUtils');

dojo.declare("snareworks.ImageUtils", null, {
	
	RIGHT_IMAGES: [
		'images/Smile.png',
		'images/Tongue.png',
		'images/Wink.png',
		'images/Wow.png',
		'images/Crazy.png',
		'images/Rolleyes.png'
	],
	
	WRONG_IMAGES: [
		'images/Angry.png',
		'images/Huh!.png',
		'images/Ohhmy.png',
		'images/Worried.png'
	],
	
	constructor: function() {
		this.RIGHT_IMAGES.index = 0;
		this.WRONG_IMAGES.index = 0;
	},
	
	nextRightImage: function() {
		return this.nextImage(this.RIGHT_IMAGES);
	},
	
	nextWrongImage: function() {
		return this.nextImage(this.WRONG_IMAGES);
	},
	
	nextImage: function(images) {
		var index = images.index;
		var src = images[index];
		var image = document.createElement('img');
		image.src = src;
		image.height = 0;
		image.width = 0;
		image.style.borderWidth = 0;
		images.index = (images.index + 1) % images.length;
		return image;
	}
	
});
